# wget https://gitee.com/xiejinglin/env-init/raw/master/log/cleaninstall.sh && sh cleaninstall.sh
#!/bin/bash
if [ ! -d "$HOME/script" ]; then
  echo "$HOME/script不存在，创建路径"
  mkdir $HOME/script
fi

# 下载clean.sh
wget -P $HOME/script https://gitee.com/xiejinglin/env-init/raw/master/log/clean.sh
chmod +x $HOME/script/clean.sh

# 新增定时任务
crontab -l > /tmp/cron.cron
echo "0 1 * * * $HOME/script/clean.sh" >> /tmp/cron.cron
crontab /tmp/cron.cron

rm -f cleaninstall.sh